package caiziyou.com.designpattern.observer.improve;

public class CurrentConditions implements Observer{
	
	private String desc;

	private float temperature;
	private float pressure;
	private float humidity;
	
	public CurrentConditions(String desc) {
		super();
		this.desc = desc;
	}

	public void update(float temperature, float pressure, float humidity) {
		this.temperature = temperature;
		this.pressure = pressure;
		this.humidity = humidity;
		display();
	}
	
	public void display() {
		System.out.println(desc+"温度----------"+temperature);
		System.out.println(desc+"气压----------"+pressure);
		System.out.println(desc+"湿度----------"+humidity);
	}
}
